﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace IntroHelloWorld
{
    class Program
    {
        static void Main(string[] args)
        {
            //Main Program Starts Here
            string again = "Y";
            while (again.ToUpper() == "Y")
            {
                Console.Clear();
                Console.WriteLine("Hello World!"); //Output Text To Screen
                Console.WriteLine("The first app in Introduction to C#!"); //Text from Beggining Visual C# 2012 Textbook changed to class title
                Console.WriteLine("CIS 142 - Ricardo Arredondo"); //Have to get them credits
                Console.WriteLine(); //Space Line
                Console.WriteLine("Lets get the extra points, and have some fun..."); //Yup
                string name; //Gotta save that name somewhere right?
                char spc = ' '; //Need this to verify valid name
                int numn; //i need it just because it wont work without it
                Console.WriteLine("Please tell me your first name:"); //give it!
            namae: //Have to come back in case you try to fake it
                name = Console.ReadLine(); //name will be saved here!
                if (name.Contains(spc)) //First Check, spaces??? i only asked for a first name
                {
                    Console.WriteLine("Provide a valid first name ONLY, no games dude:");
                    goto namae;
                }
                else if (name.Length < 3) //second check, 2 or 1 letter name? nope
                {
                    Console.WriteLine("Way to short dude, First name please:");
                    goto namae;
                }

                while (int.TryParse(name, out numn)) //third check, only numbers? nope!
                {
                    Console.WriteLine("No way your name is just some numbers, try again:");
                    goto namae;
                }

                Console.WriteLine("You may be lying, but passes the 3 low level checks, i will take it."); //May have some numbers AND letters, im too lazy to check for that, i will take it
                Console.WriteLine();
                Console.WriteLine("Hello \"{0}\", thanks for playing.", name);
                Console.WriteLine();
                Console.WriteLine("Want to try again? enter the letter \"Y\"");
                again = Console.ReadLine();
            }
            //Console.ReadKey(); //Break to prevent program from closing
        }
    }
}

